import React from 'react'
import { Table,Button } from 'antd'
import { routerRedux } from 'dva/router'
import styles from './List.less'

const List = ({ ...tableProps }) => {

  const savePlan=tableProps.savePlan
  const columns = [
    {
      title: '测试计划名称',
      dataIndex: 'fields.name',
      key: 'name',
      render: (text,record) =>  record.name,
    },{
      title: '产品名称',
      dataIndex: 'productName',
      key: 'productName',
    },{
      title: '套件名称',
      dataIndex: 'suiteName',
      key: 'suiteName',
    },{
      title: '描述',
      dataIndex: 'fields.description',
      key: 'description',
      render: (text,record) => record.description,
    },
    {
      title: '操作',
      key: 'operation',
      width: 100,
      render: (text, record) => <Button onClick={()=>savePlan(record)}>保存</Button>,
    },
  ]

  return (
    <div>
      <Table
        {...tableProps}
        bordered
        columns={columns}
        simple
        className={styles.table}
        rowKey={record => record.pk}
        rowSelection={null}
      />
    </div>
  )
}

export default List
